<script>
	function del(kd){
		if(confirm("Apakah yakin akan menghapus data?")){
			document.location="barang/del/"+kd;
		}
	}
</script>
<table cellpadding="0" cellspacing="0" border="0" class="responsive dynamicTable display table table-bordered" width="100%">
	<thead>
		<tr>
			<th>Gambar</th>
			<th>ID Barang</th>
			<th>Nama Barang</th>
			<th>Part Number</th>
            <th>Serial Number</th>
            <th>Berat</th>
			<th>Jenis</th>
			<th>Jumlah</th>
			<th width="10%">Proses</th>
		</tr>
	</thead>
	<tbody>
		<?php
			foreach($barang as $row){
				echo "<tr>
						<td><img src='".base_url()."assets/".$row->image."' width=100></td>
						<td>".$row->idbarang."</td>
						<td>".$row->nmbarang."</td>
						<td>".$row->partnumber."</td>
						<td>".$row->serialnumber."</td>
						<td>".$row->berat."</td>
						<td>".$row->nmjenis."</td>
						<td>".$row->jumlah."</td>
						<td>
							<div class='controls center'>
							   <a class='tip' href='barang/edit/".$row->idbarang."' oldtitle='Edit Data Barang' title=''><span class='icon12 icomoon-icon-pencil'></span></a>
							   <a class='tip' href='javascript:del(\"".$row->idbarang."\")' oldtitle='Hapus Data Barang' title=''><span class='icon12 icomoon-icon-remove'></span></a>
							</div>
						</td>
					</tr>";
			}
		?>
	</tbody>
</table>